<%@ page language="java" pageEncoding="utf-8"
         contentType="text/html;charset=utf-8" %>
<html>

<%@ include file="../../../common/jstl.jsp" %>

<script type="text/javascript">

    var parentChosen;

    //表单验证
    $(function () {
        /*	parentChosen = $(".chosen-select").chosen({
                no_results_text: "未找到父菜单",
                width : '100%'
            });*/

        $('#editForm').validator({
            ignore: ':hidden',
            fields: {
                name: '名称:required;length[~20]',
                orderNo: '序号:integer[+]',
                type: '类型:required;',
                parentId: '父菜单:required;'
            },
            valid: function (form) {
                //联系人
            /*    var linkman = document.getElementById("linkman").value;
                if (linkman.length == 0) {
                    alert("请输入联系人!!");
                    return;
                }
                //联系电话
                var phone = document.getElementById("phone").value;
                if (phone.length == 0) {
                    alert("请输入联系电话");
                    return;
                }*/
                var laodIdx = layer.load();
                $('#editForm').ajaxSubmit({
                    data: {},
                    traditional: true,
                    success: function (result) {
                        layer.close(laodIdx);
                        if (result.success) {
                            layer.alert('操作成功', function () {
                                window.location.reload();
                            });
                        } else {
                            layer.alert(result.msg);
                        }
                    }
                });
            }
        });
        /*$('input[name="type"]').on('click', function(){
            var val = $('input[name="type"]:checked').val();
            if(val == 'page'){
                $('#parentMenuSelect').show();
            }else{
                $('#parentMenuSelect').hide();
            }
        });*/

    });


</script>

<head>
</head>

<body>


<div id="addForm" class="mgt40">
    <form action="${ctx }/information/cnaaApplyFor/save" id="editForm" method="post">
        <input type="hidden" name="id" value="${cnaaApplyFor.id }"/>
        <div class="">
            <div class="J_formTable l_form_table">
                <table class="not_hightlight">
                    <tr id="parentMenuSelect">
                        <td class="l_title "> 等级</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_label ml10" style="width: 220px;">
                                    <select data-placeholder="选择职务" class="chosen-select" name="level">
                                        <option value="0" selected>1级</option>
                                        <option value="1">2级</option>
                                        <option value="2">3级</option>
                                    </select>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title w200"> 企业名称</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <input type="text" name="companyName" value="${cnaaApplyFor.companyName }"
                                           maxlength="20"/>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title ">联系人</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" name="linkman" id="linkman" placeholder="选填" value="${cnaaApplyFor.linkman }"
                                               maxlength="20"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "> 联系电话</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_text w200 ml10">
                                    <label>
                                        <input type="text" id="phone"  name="phone"
                                               value="${cnaaApplyFor.phone }" placeholder="选填" maxlength="11"/>
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="l_title "> 是否封存</td>
                        <td>
                            <div class="J_toolsBar fl">
                                <div class="t_check w200 ml10">
                                    <label>
                                        <input type="radio" name="deleteFlag" value="1"/>是
                                    </label>
                                    <label>
                                        <input type="radio" name="deleteFlag" value="0" checked="checked"/>否
                                    </label>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</div>

</body>
</html>